import area from '@/utils/area'

export default {
  props: {
    // 标题
    title: {
      type: String,
      default: () => '',
    },
    // 默认属性
    defaultProps: {
      type: Object,
      default: () => ({
        choice: 'choice',
        data: {
          label: 'title',
          value: 'title',
        },
      }),
    },
    columnsNum: {
      type: [String, Number],
      default: () => '1',
    },
    hasFill: {
      // 文本框
      type: Boolean,
      default: () => false,
    },
  },

  computed: {
    areaList () {
      return Object.freeze(area)
    },
  },

  methods: {
    // 地址截取
    handlerArea (area) {
      const val = this.$_
        .map(area, 'name').join(',').replaceAll(',', '/')

      this.handlerConfirm(val)
      this.validate()
    },
  },
}
